{% extends "docker_engine/base.html" %}


{% load staticfiles %}


{% block extra-css %}
<link rel="stylesheet" type="text/css" href="{% static 'docker_engine/assets/fancybox/source/jquery.fancybox.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'docker_engine/assets/uniform/css/uniform.default.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'docker_engine/assets/data-tables/DT_bootstrap.css' %}" />
<link rel="stylesheet" type="text/css" href="{% static 'docker_engine/css/custom.css' %}" />
{% endblock %}


{% block content %}
<div id="page" class="dashboard">
    <!-- BEGIN EXAMPLE TABLE PORTLET-->
    <div class="widget">
        <div class="widget-title">
            <h4><i class="icon-reorder"></i> Nodes</h4>                  
        </div>
        <div class="widget-body">
            <table class="table table-striped table-bordered">
                <thead>
                    <tr>
                        <th width="20%" class="hidden-phone">Name</th>
                        <th width="20%" class="hidden-phone">Role</th>
                        <th width="20%" class="hidden-phone">IP Adress</th>
                        <th width="20%" class="hidden-phone">Action</th>
                    </tr>
                </thead>
                <tbody>
                    {% for node in nodes %}
                    <tr class="odd gradeX">
                        <td>
                            <a href="{% url 'node_detail' node.name %}">{{ node.name }}</a>
                        </td>
                        <td>
                            {% if node.role == "M" %}
                            Managing Node
                            {% elif node.role == "C" %}
                            Computing Node
                            {% endif %}
                        </td>
                        <td>{{ node.ip_address }}</td>
                        <td>
                            <a href="{% url 'node_delete' node.name %}">
                                <button class="btn-mini btn-danger delete_button"><i class="icon-remove"></i> Delete Node</button>
                            </a>
                        </td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</div>
<!-- END EXAMPLE TABLE PORTLET-->

<!-- BEGIN BUTTONS WITH ICONS PORTLET-->
<div class="create_button">
    <p>
        <a href="{% url 'node_new' %}"><button class="btn btn-primary"><i class="icon-plus icon-white"></i> Add Computing Node</button></a>
    </p>
</div>
<!-- END BUTTONS WITH ICONS PORTLET-->    
</div> 
{% endblock %}


{% block extra-js %}
<script src="{% static 'docker_engine/assets/data-tables/jquery.dataTables.js' %}"></script>
<script src="{% static 'docker_engine/assets/data-tables/DT_bootstrap.js' %}"></script>
<script src="{% static 'docker_engine/assets/uniform/jquery.uniform.min.js' %}"></script>
<script src="{% static 'docker_engine/assets/fancybox/source/jquery.fancybox.pack.js' %}"></script>
<script src="{% static 'docker_engine/js/node/all.js' %}"></script>
<script src="{% static 'docker_engine/js/node/index.js' %}"></script>
{% endblock %}